package org.springcloud.plugin.strategy.sentinel.nacos.configuration;

import org.springcloud.plugin.stragegy.sentinel.configuration.SentinelStrategyAutoConfiguration;
import org.springcloud.plugin.stragegy.sentinel.constant.SentinelStrategyConstant;
import org.springcloud.plugin.stragegy.sentinel.loader.SentinelRuleLoader;
import org.springcloud.plugin.strategy.sentinel.nacos.loader.SentinelNacosRuleLoader;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author yanggld
 * @Date 2020/1/10-11:17
 * @Description
 */
@Configuration
@ConditionalOnProperty(value = SentinelStrategyConstant.SPRING_APPLICATION_STRATEGY_SENTINEL_ENABLED, matchIfMissing = false)
@AutoConfigureAfter(SentinelStrategyAutoConfiguration.class)
public class SentinelStrategyNacosAutoConfiguration {

	@Bean
	public SentinelRuleLoader sentinelRuleLoader() {
		return new SentinelNacosRuleLoader();
	}
}
